<template>
<div>
    <div class="common-form">{{$t('plus.event_time')}}</div>
    <el-form-item
      :label="$t('plus.signup_deadline')"
      prop="joinEndTime"
      :rules="[{  required: true,  message: $t('plus.select_signup_deadline'),  trigger: 'change'}]"


    >
      <el-col :span="11">
        <el-date-picker
          v-model="form.joinEndTime"
          type="datetime"
          :placeholder="$t('plus.signup_deadline')"
          format="YYYY-MM-DD HH:mm"
          value-format="YYYY-MM-DD HH:mm"
        ></el-date-picker>
      </el-col>
    </el-form-item>
    <el-form-item
      :label="$t('plus.activity_date')"
      prop="activeDate"
      :rules="[{  required: true,  message: $t('plus.select_event_date'),  trigger: 'change'}]"


    >
      <el-col :span="11">
        <el-date-picker
          v-model="form.activeDate"
          type="daterange"
          align="right"
          unlink-panels
          :range-separator="$t('plus.to')"
          :start-placeholder="$t('plus.event_start_date')"
          :end-placeholder="$t('plus.event_end_date')"
          format="YYYY-MM-DD"
          value-format="YYYY-MM-DD"
          :picker-options="pickerOptions"
        ></el-date-picker>
      </el-col>
    </el-form-item>

    <el-form-item
      :label="$t('plus.group_build_time')"
      :rules="[{  required: true,  message: ' '}]"
      prop="togetherTime"
    >
      <div class="max-w460 d-s-c">
        <div class="flex-1">
          <el-input v-model="form.togetherTime" type="number"></el-input>
        </div>
        <span class="pl16">{{$t('plus.hour')}}</span>
      </div>
    </el-form-item>
  </div>
</template>

<script>
export default {
  data() {
    return {
      /*如果没有后面的-8.64e7就是不可以选择今天的*/
      pickerOptions: {
        disabledDate(time) {
          return time.getTime() < Date.now() - 8.64e7;
        }
      }
    };
  },
  inject: ["form"]
};
</script>

